package com.hualan.domain;

import java.io.Serializable;
import java.util.List;

import lombok.Data;

/**
 * 咨询师表，存储所有咨询师信息
 * @TableName teacher
 */
@Data
public class Teacher implements Serializable {
    /**
     * 主键，自增
     */
    private Long id;

    /**
     * 咨询师名
     */
    private String name;

    /**
     * 头像URL
     */
    private String image;

    /**
     * 所属地址
     */
    private String address;

    /**
     * 个人简介
     */
    private String intro;

    /**
     * 是否认证(1:已认证，0：未认证)
     */
    private Integer authentication;

    /**
     * 咨询师等级id，外键关联teacherLevel表
     */
    private Long levelId;

    private static final long serialVersionUID = 1L;

    private Good goods;
    private Teacherlevel levels;
    //咨询师擅长的领域
    private List<Good> good;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Teacher other = (Teacher) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getImage() == null ? other.getImage() == null : this.getImage().equals(other.getImage()))
            && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
            && (this.getIntro() == null ? other.getIntro() == null : this.getIntro().equals(other.getIntro()))
            && (this.getAuthentication() == null ? other.getAuthentication() == null : this.getAuthentication().equals(other.getAuthentication()))
            && (this.getLevelId() == null ? other.getLevelId() == null : this.getLevelId().equals(other.getLevelId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getImage() == null) ? 0 : getImage().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getIntro() == null) ? 0 : getIntro().hashCode());
        result = prime * result + ((getAuthentication() == null) ? 0 : getAuthentication().hashCode());
        result = prime * result + ((getLevelId() == null) ? 0 : getLevelId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", image=").append(image);
        sb.append(", address=").append(address);
        sb.append(", intro=").append(intro);
        sb.append(", authentication=").append(authentication);
        sb.append(", levelId=").append(levelId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}